home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 5_6.lha / 5_6 / 5_6A.h < prev    next >
C/C++ Source or Header  |  1993-08-08  |  561b  |  29 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. / Exercise 5.6, part 1
  6. / Implement a character queue using a linked list.
  7. / <char_queue.h>
  8. ifndef CHAR_QUEUE_H
  9.  define CHAR_QUEUE_H
  10.  
  11. lass char_queue
  12.  
  13.    struct cQtable
  14.    {
  15.        char c;
  16. struct cQtable *next;
  17.    } *rear, *front;
  18.  
  19. ublic:
  20.    char_queue(int nummembers);
  21.    ~char_queue();
  22.  
  23.    void enqueue(char s);
  24.    char dequeue();
  25.    int emptyQ() { return (front == 0); }
  26.    void clearQ();
  27. ;
  28. endif /* CHAR_QUEUE_H */
  29.